// main/java/com/cinema/model/Ticket.java
package main.java.com.cinema.model;

import java.io.Serializable;
import java.time.LocalDateTime;

public class Ticket implements Serializable {
    private static final long serialVersionUID = 1L;

    private String id;
    private String showtimeId;
    private String userId;
    private int row;
    private int seat;
    private LocalDateTime purchaseTime;
    private double price;
    private boolean refunded;
    private LocalDateTime refundTime;

    // 无参构造函数
    public Ticket() {}

    // 有参构造函数
    public Ticket(String id, String showtimeId, String userId, int row, int seat,
                  LocalDateTime purchaseTime, double price) {
        this.id = id;
        this.showtimeId = showtimeId;
        this.userId = userId;
        this.row = row;
        this.seat = seat;
        this.purchaseTime = purchaseTime;
        this.price = price;
        this.refunded = false;
    }

    // Getters and Setters
    public String getId() { return id; }
    public void setId(String id) { this.id = id; }

    public String getShowtimeId() { return showtimeId; }
    public void setShowtimeId(String showtimeId) { this.showtimeId = showtimeId; }

    public String getUserId() { return userId; }
    public void setUserId(String userId) { this.userId = userId; }

    public int getRow() { return row; }
    public void setRow(int row) { this.row = row; }

    public int getSeat() { return seat; }
    public void setSeat(int seat) { this.seat = seat; }

    public LocalDateTime getPurchaseTime() { return purchaseTime; }
    public void setPurchaseTime(LocalDateTime purchaseTime) { this.purchaseTime = purchaseTime; }

    public double getPrice() { return price; }
    public void setPrice(double price) { this.price = price; }

    public boolean isRefunded() { return refunded; }
    public void setRefunded(boolean refunded) { this.refunded = refunded; }

    public LocalDateTime getRefundTime() { return refundTime; }
    public void setRefundTime(LocalDateTime refundTime) { this.refundTime = refundTime; }
}
